#include "tcpserver_thread.h"

Tcpserver_Thread::Tcpserver_Thread(QTcpSocket *s)
{
    client = s;
}


Tcpserver_Thread::~Tcpserver_Thread()
{

}


void Tcpserver_Thread::run()
{

    connect(client, &QTcpSocket::readyRead, this, &Tcpserver_Thread::clientinfo);
}

void Tcpserver_Thread::clientinfo()
{
    QByteArray ba = client->readAll();
    qDebug() << "服务器接受客户端发送的信息：" << QString(ba);
    ba += "收到";
    client->write(ba);
}
